package fashionshop.app;

import java.awt.AWTEvent;
import java.awt.EventQueue;

import javax.swing.JOptionPane;

public class EventQueueProxy extends EventQueue {

	@Override
    protected void dispatchEvent(AWTEvent event) {
        try {
            super.dispatchEvent(event);
        } catch (Throwable ex) {
            ex.printStackTrace(System.out);
            String message = ex.getMessage();
            if (message == null || message.length() == 0) {
                message = "Fatal: " + ex.getClass();
            }
            JOptionPane.showMessageDialog(null, message, "Unexpected system error", JOptionPane.ERROR_MESSAGE);
        }
    }
}
